package com.mi.singleton;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class Config {

	private static Config config;
	static{
		try {
			config = new Config();
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}
	
	public static Config getUniqueInstance() throws FileNotFoundException, IOException{
		return config;
	}
	
	
	private Properties properties;
	
	private Config() throws FileNotFoundException, IOException{
		properties = new Properties();
		properties.load(new FileInputStream(new File("E:\\eclipseEE-Workspace\\Mi-test\\src\\com\\mi\\singleton\\config.properties")));
	}
	
	
	
	
	public String getProperty(String name){
		return properties.getProperty(name);
	}
	
}
